function Swiper(lele){
this.el=document.querySelector(lele)
this.num=1


this.ulLiObjs=this.el.querySelectorAll('ul li')
this.imgObj=this.el.querySelector('img')

this.init()
}


Swiper.prototype.init=function(){
 this.haha()
this.yiru()
this.yichu()

}
Swiper.prototype.haha=function(){
    this.dingshi=setInterval(()=>{
         if(this.num>=6) this.num=0
         this.num++
         this.imgObj.src=`./imgs/img${this.num}.jpg`
  
       
         this.ulLiObjs.forEach((item,i)=>{
             
              item.className=''
              this.ulLiObjs[this.num-1].className='active'
                 
         
  
         })
  
      },1000)
  

}
Swiper.prototype.yiru=function(){
 

  this.ulLiObjs.forEach((item,i)=>{
          item.onmouseover=()=>{
              clearInterval(this.dingshi)
              this.num = i+1
              this.imgObj.src=`./imgs/img${ this.num}.jpg`
              this.el.querySelector('ul li.active').className=''
              this.ulLiObjs[ this.num-1].className='active'
          }
        



  })

}
Swiper.prototype.yichu=function(){  
    this.ulLiObjs.forEach((item,i)=>{
    this.ulLiObjs[i].onmouseout=()=>{
    this.haha()
    }
})
}



